/*
 * Copyright (c) 2012 Keerthi Ramachandran .
 */
package com.kee.example.domain;

import javax.persistence.Embeddable;

import org.apache.commons.lang.builder.EqualsBuilder;
import org.apache.commons.lang.builder.HashCodeBuilder;

/**
* This class... todo (RK) javadoc
*
* @author <a href="mailto:Keerthi.Ramachandran@navis.com">Keerthi Ramachandran</a>, 8/29/12
* @since 2.4. /2012-08-29
*/
@Embeddable
public class Address {
    private String street;
    private String zipCode;
    private String city;

    public Address() {
    }

    public Address(String inStreet, String inZipCode, String inCity) {
        street = inStreet;
        zipCode = inZipCode;
        city = inCity;
    }

    public String getStreet() {
        return street;
    }

    public void setStreet(String inStreet) {
        street = inStreet;
    }

    public String getZipCode() {
        return zipCode;
    }

    public void setZipCode(String inZipCode) {
        zipCode = inZipCode;
    }

    public String getCity() {
        return city;
    }

    public void setCity(String inCity) {
        city = inCity;
    }

    @Override
    public int hashCode() {
        return new HashCodeBuilder().append(this.street).append(this.zipCode).append(this.city).toHashCode();
    }

    @Override
    public boolean equals(Object obj) {
        if (obj == null) {
            return false;
        }
        if (getClass() != obj.getClass()) {
            return false;
        }
        final Address other = (Address) obj;
        return new EqualsBuilder().append(this.street, other.street).append(this.zipCode, other.zipCode).append(this.city, other.city).isEquals();
    }
}
